package com.whutosa.template.server.model;

import com.yml666.jpa.utils.annotation.Constraint;
import com.yml666.jpa.utils.annotation.ConstraintType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;

/**
 * Created by 19110 on 2016/9/12.
 */
@ApiModel("Person(人)")
@Entity
public class Person {
    @ApiModelProperty("编号")
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer pid;
    @ApiModelProperty("姓名")
    @NotNull
    @Constraint
    private String name;
    @ApiModelProperty("年龄")
    @Constraint(ConstraintType.GREATER_THAN_OR_EQUAL_TO)
    private Integer age;

    public Person() {
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
}
